package org.example.qqrobot.config;


import org.example.qqrobot.interceptor.JwtTokenUserInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;



    @Configuration//配置类
//用于注册拦截器，注册了才可以用
    public class WebConfig implements WebMvcConfigurer {
        @Autowired
        private JwtTokenUserInterceptor loginCheckInterceptor;

        @Override
        public void addInterceptors(InterceptorRegistry registry) {
            registry.addInterceptor(loginCheckInterceptor).addPathPatterns("/**").excludePathPatterns("/user/login");
        }




    }

